package cn.com.tbshuda.fastdfsthreadlocal.controller;

import cn.com.tbshuda.fastdfsthreadlocal.fast.FdfsByPorperties;
import cn.com.tbshuda.fastdfsthreadlocal.fast.FileClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;
import java.util.Map;

/**
 * @author: wsd
 * @date: 2021/4/27 10:13
 */
@RestController
public class UploadFile {
    @Autowired
    private FileClient fileClient;
    @Autowired
    private FdfsByPorperties fdfsByPorperties;

    @RequestMapping("/uploadFile")
    public Map uploadFileOne(){
        File pdfFile = new File("D:\\得到的.jpg");
        Map s = fileClient.uploadFile(pdfFile);
        System.out.println("上传后:"+s);
        System.out.println("fdfsByPorperties:"+fdfsByPorperties);
        return s;
    }

}
